package com.liurz.mongdb.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Data
@Document(collection="jSONObject")
public class Sensor {

    @Id
    @Field("_id")
    private String _id;

    /**
     * 主键id
     */
    @Field("id")
    private String id;

    /**
     * 类型为 device-sensor
     */
   // private String type = TMSchema.TypeEnum.DEVICE_SENSOR.getKey();

    /**
     * 传感器类型id
     */
    private String sensorTypeId;

    /**
     * 传感器类型code
     */
    private String sensorTypeCode;

    /**
     * 监测区域id
     */
    private String monitorAreaId;

    /**
     * 厂商id
     */
    private Integer manufacturerId;

    /**
     * 网关id
     */
    private String gateWayId;

    /**
     * 网关设备id
     */
    private String gatewayDeviceId;

    /**
     * 协议id
     */
    private Integer protocolId;

    /**
     * 厂商编码
     */
    private String manufacturerCode;

    /**
     * 厂商名称
     */
    private String manufacturerName;

    /**
     * 传感器自定义名称
     */
    private String name;

    /**
     * 传感器code
     */
    private String code;

    /**
     * 序号
     */
    private String num;

    /**
     * 更新时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private String updateTime;

    /**
     * 创建人
     */
    private String createUser;

}
